#ifndef _NVETH_FLOW_OFFLOAD_H
#define _NVETH_FLOW_OFFLOAD_H

#include <linux/if_ether.h>
#include <linux/rhashtable.h>
#include <linux/ip.h>
#include <linux/ipv6.h>

struct nveth_foe_entry {
	u32 ib1;
	u32 data[23];
#if 0
	union {
		struct mtk_foe_bridge bridge;
		struct mtk_foe_ipv4 ipv4;
		struct mtk_foe_ipv4_dslite dslite;
		struct mtk_foe_ipv6 ipv6;
		struct mtk_foe_ipv6_6rd ipv6_6rd;
		u32 data[23];
	};
#endif
};


struct nveth_flow_entry {
	union {
		struct hlist_node list;
		struct {
			struct rhash_head l2_node;
			struct hlist_head l2_flows;
		};
	};
	u8 type;
	s8 wed_index;
	u8 ppe_index;
	u16 hash;
	union {
		struct nveth_foe_entry data;
		struct {
			struct nveth_flow_entry *base_flow;
			struct hlist_node list;
		} l2_data;
	};
	struct rhash_head node;
	unsigned long cookie;
};

/*inner usage only, for temperarily save flow data*/
struct nveth_flow_data {
	struct ethhdr eth;

	union {
		struct {
			__be32 src_addr;
			__be32 dst_addr;
		} v4;

		struct {
			struct in6_addr src_addr;
			struct in6_addr dst_addr;
		} v6;
	};

	__be16 src_port;
	__be16 dst_port;

	u16 vlan_in;

	struct {
		u16 id;
		__be16 proto;
		u8 num;
	} vlan;
};


#endif
